<template>
	<view class="add-observe">
		<view class="header">
			<rf-navbar title="创建学期评价" src="../../static/images/observe/add-observe-bg_top.png"
				@click="onBack"></rf-navbar>
			<image class="bg-bottom" :style="{top:navBarHeight}"
				src="../../static/images/observe/add-observe-bg_bottom.png" mode="widthFix"></image>
		</view>
		<view class="body plr40">
			<view class="form">
				<u--form :model="form" ref="uForm" labelPosition="top" labelWidth="300rpx">
					<u-form-item prop="childName" @click="pushEvalChild">
						<view class="title">评价的幼儿</view>
						<view class="cell">
							<view class="icon">
								<image class="icon_img icon-smile"></image>
							</view>
							<u--input v-model="slChildName" disabled disabledColor="#ffffff" fontSize="14pt"
								placeholder="请选择">
							</u--input>
							<view class="arrow">
								<u-icon slot="right" name="arrow-right" color="#444444"></u-icon>
							</view>
						</view>
					</u-form-item>

					<u-form-item prop="beBornDt" @click="showStep = true;">
						<view class="title">评价的学期</view>
						<view class="cell">

							<view class="icon">
								<image class="icon_img icon-date"></image>
							</view>
							<u--input v-model="startAndendDate" disabled disabledColor="#ffffff" fontSize="14pt"
								placeholder="请选择"></u--input>
							<view class="arrow">
								<u-icon slot="right" name="arrow-right" color="#444444"></u-icon>
							</view>
						</view>
					</u-form-item>

					<!-- <view class="create-wrap">
						<view class="observe-assistant" @click="assistantShowOpen">
							<view style="display: flex; justify-content: center; align-items: center;">
								<image class="icon icon-assistant" />
								<text
									style="display: block; margin-left: 8px; letter-spacing: 3rpx; font-size: 32rpx;">AI生成学期评价</text>
							</view>
						</view>
						<view class="save-btn" style="letter-spacing: 3rpx; font-size: 32rpx;">
							<u-button text="保存" @click="handleSave"></u-button>
						</view>
					</view> -->
					<rf-submit cancelText="AI生成学期评价" confirmText="保存" @handleUseAi="assistantShowOpen"
						@handleSave="handleSave"></rf-submit>

					<u-form-item prop="parentPhone">
						<view class="title">学期评价</view>
						<view class="observe-analyze-measure-input" style="color: black; margin-top: 16rpx;">
							<u--textarea v-model="contentAndanalyze" placeholder="请输入你对孩子的本学期评价" autoHeight
								maxlength="-1" :confirmType="done"></u--textarea>
						</view>
					</u-form-item>
				</u--form>

			</view>

			<!-- <view class="f32 bold mt30">学期评价</view>
			<view class="observe-analyze-measure-input ">
				<u--textarea v-model="form.aiAnalysis" placeholder="请输入你对孩子的本学期评价" autoHeight
					maxlength="-1"></u--textarea>
			</view> -->
			<view class="mt50" style="margin-top: 70rpx; margin-left: -12px;margin-right: -12px;">
				<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
					uploadIcon="plus" :maxCount="maxCount" :capture="['album']" :accept="mediaType">

				</u-upload>
			</view>


		</view>

		<rf-loading :loading="aiAssistant" @click="onclickHide" title="返回首页等待"></rf-loading>

		<!-- 填写学期评价输入提醒 -->
		<rf-toast :show="toast1" :isSus="false" :title="errMsg" @click="toast1 = false"></rf-toast>

		<!-- ai 分析选项 -->
		<view class="assistant-popup" v-if="assistantPopupShow">
			<u-popup :safeAreaInsetBottom="false" :show="assistantPopupShow" mode="center"
				@close="assistantPopupShow = false">
				<view style="margin-bottom: -10px;">
					<image class="assistant-icon" src="../static/images/common/icon-eval.png"></image>
					<view class="title f32 bold inline">超级小助教</view>
					<view class="select-cnt">
						<view style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;">
							<u-radio-group v-model="assistant[0].value" placement="column" @change="handleAssistant">
								<!-- <u-radio :customStyle="{marginBottom: '20rpx'}" style="font-size: 8px;" key="0"
									name="Additional.Items.WithGuidebook" shape="circle" activeColor="#58C866"
									inactiveColor="#E3E6E9" labelSize="14px" size="16">
									<view>请结合《指南》<text
											style="color: #58C866;text-decoration: underline; text-decoration-color: #58C866;"
											@click="assistantItemShow = true">{{areas1}}</text>
										<image class="icon-arrow-green" style="width: 20rpx;height: 20rpx;"></image>进行分析
									</view>
								</u-radio> -->
								<u-radio key="1" name="Additional.Items.Freely" shape="circle" activeColor="#58C866"
									inactiveColor="#E3E6E9" labelSize="14px" size="16">
									<view>请结合<text
											style="color: #58C866;text-decoration: underline; text-decoration-color: #58C866;"
											@click="assistantItemShow = true">{{areas2}}</text>
										<image class="icon-arrow-green" style="width: 20rpx;height: 20rpx;"></image>
										进行学期评价
									</view>
								</u-radio>
							</u-radio-group>
						</view>
						<view
							style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;margin-top: 10px;">
							<u-radio-group v-model="assistant[1].value" placement="column">
								<u-radio key="3" label="需要家园共育建议" name="Additional.Items.FamilyEducation"
									:selectiveState="2" shape="circle" activeColor="#58C866" inactiveColor="#E3E6E9"
									labelSize="14px" size="16">
								</u-radio>
							</u-radio-group>
						</view>
						<view
							style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;margin-top: 10px;">
							<u-radio-group v-model="assistant[2].value" placement="column">
								<u-radio :customStyle="{marginBottom: '20rpx'}" key="4" label="请写的详细一些"
									name="Content.Length.More" shape="circle" activeColor="#58C866"
									inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-radio>
								<u-radio key="5" label="请写的简略一些" name="Content.Length.Less" shape="circle"
									activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-radio>
							</u-radio-group>
						</view>
						<view
							style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;margin-top: 10px;">
							<u-radio-group v-model="assistant[3].value" placement="column">
								<u-radio :customStyle="{marginBottom: '20rpx'}" key="7" label="请用给孩子一封信的形式书写"
									name="Content.Professional.Popular" shape="circle" activeColor="#58C866"
									inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-radio>
								<u-radio key="6" label="请用专业学术的形式书写" name="Content.Professional.Expert" shape="circle"
									activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-radio>
							</u-radio-group>
						</view>

					</view>
					<view style="height: 45px; margin: 10px 15px; display: flex; justify-content: space-between;">
						<view class="inline assistant-btn f32">
							<u-button text="取消" @click="assistantPopupShow = false"></u-button>
						</view>
						<view class="inline assistant-btn f32 save">
							<u-button text="确定" @click="handleAssistantSave"></u-button>
						</view>
					</view>
				</view>
			</u-popup>
		</view>
		<!-- 选择领域 -->
		<view class="assistant-popup" v-if="assistantItemShow">
			<u-popup :safeAreaInsetBottom="false" :show="assistantItemShow" mode="center"
				@close="assistantItemShow = false">
				<view style="margin-bottom: -10px;">
					<view class="title f32 bold inline">请选择</view>
					<view class="select-cnt">
						<view style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;">
							<u-radio-group v-model="selectAll" placement="column" @change="selectAssistant">
								<u-radio style="font-size: 8px;" key="0" label="相关领域" :name="true" shape="circle"
									activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-radio>
							</u-radio-group>
						</view>

						<view
							style="background-color: #F7F9FA;padding: 10px 10px; border-radius: 6px;margin-top: 10px;">
							<u-checkbox-group v-model="areas" placement="column" @change="selectAssistant">
								<u-checkbox :customStyle="{marginBottom: '30rpx'}" key="1" label="健康" name="健康"
									shape="circle" activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px"
									size="16">
								</u-checkbox>
								<u-checkbox :customStyle="{marginBottom: '30rpx'}" key="2" label="语言" name="语言"
									shape="circle" activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px"
									size="16">
								</u-checkbox>
								<u-checkbox :customStyle="{marginBottom: '30rpx'}" key="4" label="科学" name="科学"
									shape="circle" activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px"
									size="16">
								</u-checkbox>
								<u-checkbox :customStyle="{marginBottom: '30rpx'}" key="3" label="社会" name="社会"
									shape="circle" activeColor="#58C866" inactiveColor="#E3E6E9" labelSize="14px"
									size="16">
								</u-checkbox>
								<u-checkbox key="5" label="艺术" name="艺术" shape="circle" activeColor="#58C866"
									inactiveColor="#E3E6E9" labelSize="14px" size="16">
								</u-checkbox>
							</u-checkbox-group>
						</view>
					</view>
					<view style="height: 45px; margin: 10px 15px; display: flex; justify-content: space-between;">
						<view class="inline assistant-btn f32">
							<u-button text="取消" @click="assistantItemShow = false"></u-button>
						</view>
						<view class="inline assistant-btn f32 save">
							<u-button text="确定" @click="selectAssistantItem"></u-button>
						</view>
					</view>
				</view>
			</u-popup>
		</view>


		<!-- 选择评价的学期时间 -->
		<view class="popup">

			<u-popup :show="showStep" :safeAreaInsetBottom="false" :round="10" mode="bottom">
				<view
					style="display: flex;justify-content: center;align-items: center;height: 80rpx;font: bold;letter-spacing: 3rpx;">
					评价的学期
				</view>
				<view style="display: flex;width: 100%;">
					<view style="width: 100%; ">
						<picker-view v-if="visible" :indicator-style="indicatorStyle" :value="value"
							@change="bindStartDate" class="picker-view">
							<picker-view-column>
								<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
							</picker-view-column>
							<!-- <picker-view-column>
								<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
							</picker-view-column>
							<picker-view-column>
								<view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>
							</picker-view-column> -->
						</picker-view>
					</view>

					<view style="width: 100%;">
						<picker-view v-if="visible" :indicator-style="indicatorStyle" :value="semesterIndex"
							@change="bindEndDate" class="picker-view">
							<picker-view-column>
								<view class="item" v-for="(item,index) in semester" :key="index">{{item}}</view>
							</picker-view-column>
							<!-- 	<picker-view-column>
								<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
							</picker-view-column>
							<picker-view-column>
								<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
							</picker-view-column> -->
						</picker-view>
					</view>
				</view>
				<view class="picker-btn">
					<view class="btn" @click="showStep = false">取消</view>
					<view class="btn confirm" @click="pickerChange">确定</view>
				</view>
			</u-popup>
		</view>

		<!-- <view class="popup">
			<u-popup :show="showStep" :safeAreaInsetBottom="false" :round="10" mode="bottom">
				<view class="popup-term">
					<view class="title">
						评价的学期
					</view>
					<view>
						<view class="item" :class="{bg:selectIndex == 1}" @click="OnClickedSelect(1)">
							<view class="text">春季学期</view>
							<view class="icon-check mark" :class="{show:selectIndex == 1}">
							</view>
						</view>
						<view class="item" :class="{bg:selectIndex == 2}" @click="OnClickedSelect(2)">
							<view class="text">夏季学期</view>
							<view class="icon-check mark" :class="{show:selectIndex == 2}">
							</view>
						</view>
						<view class="item" :class="{bg:selectIndex == 3}" @click="OnClickedSelect(3)">
							<view class="text">秋季学期</view>
							<view class="icon-check mark" :class="{show:selectIndex == 3}">
							</view>
						</view>
						<view class="item" :class="{bg:selectIndex == 4}" @click="OnClickedSelect(4)">
							<view class="text">冬季学期</view>
							<view class="icon-check mark" :class="{show:selectIndex == 4}">
							</view>
						</view>
					</view>
					<view class="picker-btn">
						<view class="btn" @click="showStep = false">取消</view>
						<view class="btn confirm" @click="pickerChange">确定</view>
					</view>
				</view>
			</u-popup>
		</view> -->

		<!-- 按次支付观察使用 -->
		<rf-qrAlert :show="showQR" :QRUrl="QRUrl" @close="showQR=false" @confirm="handleAssistantSave"></rf-qrAlert>

		<rf-payAlert :show="android_payConfirmShow" @close="android_payConfirmShow=false" @cancel="onClicktoVip"
			@confirm="android_payConfirm" title="温馨提示" cancelText="成为VIP会员" confirmText="确定缴费">
			<view>您当前还不是超小助VIP会员，此次分析需要<text class="
					red ">{{univalence}}</text>元呦～</view>
		</rf-payAlert>


		<!-- 是否将观察，保存为草稿 -->
		<rf-alert :show="draftShow" @close="draftConfirm" @confirm="draftConfirm" title="温馨提示" desc="是否保存为草稿？"
			confirmText="是" cancelText="否"></rf-alert>
		<!-- 徽章 -->
		<rf-alertBadge :show="alertBadgeShow" :imageUrl="result.imageUrl" :name="result.name" :remark="result.remark"
			@close="alertBadgeHide"></rf-alertBadge>

		<rf-toast :show="savePopupShow" :isSus="isSus" :title="warning" @click="savePopupShow = false"></rf-toast>

		<rf-load :loading="loading" title="加载中..."></rf-load>

		<rf-alert :show="draft2Show" @close="draft2Show = false" @confirm="draft2Confirm" title="温馨提示"
			desc="此幼儿没有观察记录，如想进行学期评价，请先创建观察记录。" confirmText="确定" cancelText="取消"></rf-alert>

		<rf-toast :show="draft3Show" :isSus="false" title="提示" des="此幼儿在该学期没有观察记录，无法创建该学期评价。"
			@click="draft3Show = false"></rf-toast>
		<view class="" v-if="showPage">
			<page-container :show="showPage" :overlay="false" @beforeleave="beforeleave('showPage')"></page-container>
		</view>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapState,
	} from 'vuex'; //引入mapState

	import {
		creatEvaluate,
		updateEvaluate,
		getAiById,
		createEvaluateOrder,
	} from '@/api/eval.js'

	import {
		uploadfile,
		deletefile,
		getObservationLocation,
		getObservationSegment,
		addAiCount,
		getAgreement,
		getServiceQRCode,
		getTeacherInfo,
		getTermCount,
	} from '@/api/user.js'

	import toast from '../../uni_modules/uview-ui/libs/config/props/toast';
	import {
		from,
		interval,
		BehaviorSubject,
	} from 'rxjs';
	import {
		catchError,
		concatMap,
		delay,
		switchMap,
		takeWhile,
		tap,
		map,
		filter,
		take,
	} from 'rxjs/operators';

	export default {
		data() {
			const date = new Date()
			const years = []
			const year = date.getFullYear()
			const months = []
			const month = date.getMonth() + 1
			const days = []
			const day = date.getDate()
			for (let i = 1990; i <= date.getFullYear(); i++) {
				years.push(i)
			}
			for (let i = 1; i <= 12; i++) {
				months.push(i)
			}
			for (let i = 1; i <= 31; i++) {
				days.push(i)
			}
			return {
				loading: false, // 加载中。。。

				title: 'picker-view',
				years,
				year,
				months,
				month,
				days,
				day,
				value: [9999, month - 1, day - 1],
				visible: true,
				indicatorStyle: `height: 50px;`,
				semester: ["春季学期", "秋季学期"],
				semesterIndex: 0,




				showPage: true, //一开始设置为显示
				cache: true,

				navBarHeight: this.navBarHeight,
				screenWidth: this.screenWidth,
				screenHeight: this.screenHeight,

				form: {
					startTime: "",
					endTime: "",
					name: "",
					childId: "",
					teacherId: "",
					id: "",
					content: '',

					imageList: [],
					aiAnalysis: '', // ai分析的结果
					areas: [], // 其他领域

					aiAnalysisReq: "", // ai分析的条件
					status: "0", //  ai状态为0：未使用，1:已生成，2:生成中，
					season: 1, // 学期，默认春季学期
				},

				slChildName: "", // 选择评价的孩子
				fileList1: [],
				observerAnalyzeMeasure: '',

				showStep: false, // 
				observeSteps: [], // 观察环节，列表
				observeLocations: '',
				observeLink: '',

				aiAssistant: false, // 智能分析中

				// 弹出提示
				savePopupShow: false,
				warning: "",

				assistantPopupShow: false,
				assistantItemShow: false,
				assistantSelect: [],
				selectAll: true, // 选择领域，全选
				areas1: "相关领域",
				areas2: "相关领域",
				assistant: [{
						value: 'Additional.Items.Freely'
					},
					{
						value: 'Additional.Items.FamilyEducation'
					},
					{
						value: 'Content.Length.More'
					},
					{
						value: 'Content.Professional.Popular'
					},
				],
				areasSelestItems: [{
						name: "健康",
						value: "健康"
					},
					{
						name: "语言",
						value: "语言"
					},
					{
						name: "科学",
						value: "科学"
					},
					{
						name: "社会",
						value: "社会"
					},
					{
						name: "艺术",
						value: "艺术"
					},
				],
				areas: [],
				areas1s: [],
				areas2s: [],
				isSus: false,


				toast1: false,
				errMsg: "",

				type: "", // 状态用于标识编辑，还是新增观察


				showVip: false, // vip 续费弹窗

				univalence: 0.0, // ai分析单次使用费用
				payConfirmShow: false,
				systemInfo: {}, //系统信息

				draftShow: false,
				draft2Show: false, // 创建学期评价时，如果没有观察记录，提示创建观察记录
				draft3Show: false, // 创建学期评价时，无法创建历史观察记录，提示

				alertBadgeShow: false, // 获取勋章提示
				result: {},

				fileType: "media",

				selectIndex: "",

				android_payConfirmShow: false,

				showQR: false,
				QRUrl: "",
				slChild: "",
			}
		},
		watch: {
			assistantItemShow(e) {
				this.assistantPopupShow = !e
				console.log(JSON.stringify(this.areas));
			},
			selectIndex(newVal) {
				const currentDate = new Date();
				var year = currentDate.getFullYear();
				if (newVal == 1) {
					this.form.startTime = year + "-01"
					this.form.endTime = year + "-03"
				} else if (newVal == 2) {
					this.form.startTime = year + "-04"
					this.form.endTime = year + "-06"
				} else if (newVal == 3) {
					this.form.startTime = year + "-07"
					this.form.endTime = year + "-09"
				} else if (newVal == 4) {
					this.form.startTime = year + "-10"
					this.form.endTime = year + "-12"
				}
			}
		},
		computed: {
			...mapState(["userInfo"]),
			maxCount() {
				if (this.fileType == "image") {
					return 9
				} else {
					return 1
				}
			},
			mediaType() {
				if (this.fileList1.length <= 0) {
					return "media"
				}
				return this.fileType
			},
			storage() {
				return (this.form.content != "" && this.form.content != null) || (this.form.aiAnalysis != null && this.form
					.aiAnalysis != "")
			},
			contentAndanalyze: {
				get() {
					if (this.form.aiAnalysis.length > 0) {
						return (this.form.content + "\r\n\r\n\r\n" + this.form.aiAnalysis)
					} else {
						return this.form.content
					}
				},
				set(newValue) {
					// 将新值分配给依赖的数据属性
					this.form.content = newValue
				},
			},
			startAndendDate() {
				if (this.form.startTime.length <= 0 || this.form.endTime.length <= 0) {
					return null
				}
				if (this.semesterIndex == 0) {
					this.form.startTime = this.year + "-02-01"
					this.form.endTime = this.year + "-08-31"
				} else {
					this.form.startTime = this.year + "-09-01"
					this.form.endTime = (this.year + 1) + "-01-31"
				}
				return (this.year + "年  " + (this.semesterIndex == 0 ? "春季学期" : "秋季学期"))
			}
		},
		created() {
			// 弹出徽章
			this.visibility$ = new BehaviorSubject(this.alertBadgeShow);
			this.visibility$.subscribe(isVisible => {
				this.alertBadgeShow = isVisible;
			});
		},
		mounted() {
			// 处理从第二个页面传递过来的参数
			uni.$on('selectEvalChilds', (data) => {
				console.log(JSON.parse(decodeURIComponent(data)));
				this.slChild = JSON.parse(decodeURIComponent(data))
				this.form.name = this.slChild.username;
				this.slChildName = this.slChild.username;
				this.form.childId = this.slChild.childId;
			});
		},
		onUnload() {
			uni.$off('selectEvalChilds')
		},
		onLoad(options) {

			this.form.teacherId = this.userInfo.id;
			console.log(this.userInfo);
			// 获取系统信息
			this.systemInfo = uni.getSystemInfoSync()
			console.log("----------------------");
			console.log(this.systemInfo.platform);


			// 获取缓存信息
			var draft = uni.getStorageSync("eval_draft")

			// 如果来自于观察首页的编辑，则填充内容
			// 状态用于标识编辑，还是新增观察
			this.type = options.type
			if (options.type === "update") {
				const item = JSON.parse(decodeURIComponent(options.item))
				console.log("==========================" + JSON.stringify(item));
				this.form.id = item.id
				// 观察实录
				this.form.content = item.content

				// 图片列表
				if (item.imagesList && item.imagesList != undefined) {
					this.fileList1 = item.imagesList.map((ele) => {
						return {
							url: ele.url
						}
					})
					if (this.isVideoUrl(this.fileList1[0].url)) {
						this.fileType = "video"
					} else {
						this.fileType = "image"
					}
				}

				// ai分析
				// this.form.aiAnalysis = item.aiAnalysis
				this.form.status = item.status
				// 观察孩子
				this.form.name = item.name;
				this.slChildName = item.name;
				this.form.childId = item.childId;

				this.form.startTime = item.startTime;
				this.form.endTime = item.endTime;
				this.form.teacherId = item.teacherId;
				this.form.season = item.season;
				this.semesterIndex = (this.form.season == 1 ? 0 : 1)

				console.log("-----------" + this.form.startTime + this.form.endTime);

			} else if (draft && options.type === "create") {
				const item = JSON.parse(draft)
				this.form.id = item.id
				// 观察实录
				this.form.content = item.content
				// 图片列表
				if (item.imagesList) {
					this.fileList1 = item.imagesList
				}

				// ai分析
				// this.form.aiAnalysis = item.aiAnalysis
				this.form.status = item.status
				// 观察孩子
				this.form.name = item.name;
				this.slChildName = item.name;
				this.form.childId = item.childId;

				this.form.startTime = item.startTime;
				this.form.endTime = item.endTime;
				this.form.teacherId = item.teacherId;
				this.form.season = item.season;
				this.semesterIndex = (this.form.season == 1 ? 0 : 1)

			} else {
				// 默认当前年份 春季学期
				this.semesterIndex = 0
				this.form.season = 1;
				this.form.startTime = this.year + "-02-01"
				this.form.endTime = this.year + "-08-31"
			}



			// 获取单次使用ai的费用
			this.get_univalence()
		},


		methods: {
			...mapMutations(["updateState", "updateUserInfo", "updateBadge"]),
			isVideoUrl(url) {
				// 视频常见后缀名列表
				const videoExtensions = ['mp4', 'flv', 'avi', 'wmv', 'mov', 'mkv', 'rm', 'rmvb'];

				// 获取url的最后一部分（通常为文件名+后缀）
				const fileName = url.split('/').pop();

				// 分离出文件后缀名
				const fileExtension = fileName.split('.').pop().toLowerCase();

				// 判断后缀名是否在视频格式列表中
				return videoExtensions.includes(fileExtension);
			},
			OnClickedSelect(index) {
				this.selectIndex = index;
				this.form.season = index;

			},
			toastShow(bl, suc, title) {
				this.savePopupShow = bl;
				this.isSus = suc;
				this.warning = title;
			},
			dismiss() {
				this.savePopupShow = false;
			},
			pickerChange() {
				this.showStep = false;

				// this.startAndendDate = this.form.startTime + "至" + this.form.endTime
			},
			bindStartDate: function(e) {

				const val = e.detail.value
				this.year = this.years[val[0]]
				this.form.startTime = this.year
				this.form.endTime = this.year
				console.log("--------------" + this.year);
				// this.month = this.months[val[1]]
				// this.day = this.days[val[2]]
				// this.form.startTime = this.year + "年" + this.month + "月"
			},
			bindEndDate: function(e) {
				// 学期春季学期为02.01-08.31  秋季学期为09.01-01.31
				const val = e.detail.value
				// semester: ["春季学期", "秋季学期"],
				if (this.semester[val[0]] == "春季学期") {
					this.semesterIndex = 0
					this.form.season = 1;
					this.form.startTime = this.year + "-02-01"
					this.form.endTime = this.year + "-08-31"
				} else {
					this.semesterIndex = 1
					this.form.season = 3;
					this.form.startTime = this.year + "-09-01"
					this.form.endTime = (this.year + 1) + "-01-31"
				}
			},

			pushEvalChild() {

				const selChild = this.slChild ? encodeURIComponent(JSON.stringify(this.slChild)) : ""
				uni.navigateTo({
					url: "/pages-sub/evalChild/evalChild?selChild=" + selChild
				})
			},
			// page 卸载前执行
			beforeleave() {
				this.showPage = false
				if (this.storage && this.cache) {
					this.draftShow = true;
				} else {
					let pages = getCurrentPages();
					if (pages.length > 1) {
						uni.navigateBack();
					}
				}
			},
			alertBadgeHide() {
				this.visibility$.next(!this.alertBadgeShow);
				// this.alertBadgeShow = false;
				// let pages = getCurrentPages();
				// if (pages.length > 1) {
				// 	uni.navigateBack();
				// }
			},
			selectAssistant(e) {
				console.log("e----------------");
				console.log(e);
				if (e == true) {
					this.areas = []
				}
				if (e.length > 0) {
					console.log(">0");
					this.selectAll = false;
				} else {
					console.log("<=0");
					this.selectAll = true;
				}
			},
			selectAssistantItem() {
				this.assistantItemShow = false;
				console.log(this.assistant[0].value);
				if (this.assistant[0].value == "Additional.Items.Freely") {
					this.areas1s = this.areas;
					if (this.areas.length > 0) {
						this.areas1 = this.formDataAreas(this.areas);
					} else {
						this.areas1 = "相关领域";
					}

				}

				if (this.assistant[0].value == "Additional.Items.Freely") {
					this.areas2s = this.areas;
					if (this.areas.length > 0) {
						this.areas2 = this.formDataAreas(this.areas);
					} else {
						this.areas2 = "相关领域";
					}
				}
			},
			formDataAreas(arr) {
				var area = []
				for (var i = 0; i < arr.length; i++) {
					for (var m = 0; m < this.areasSelestItems.length; m++) {
						if (this.areasSelestItems[m].value == arr[i]) {
							area.push(this.areasSelestItems[m].name + '领域')
						}
					}
				}
				return area.toString();
			},
			onBack() {
				let pages = getCurrentPages();
				if (pages.length > 1) {
					uni.navigateBack();
				}
			},
			draft2Confirm(e) {
				console.log("draft2Confirm", +encodeURIComponent(JSON.stringify(
					this.slChild)));
				// encodeURIComponent(JSON.stringify(
				// 	item))
				uni.redirectTo({
					url: '/pages-sub/observeAdd/addObserve?type=create&child=' + encodeURIComponent(JSON.stringify(
						this.slChild))
				})
			},
			draftConfirm(e) {
				// 是否保存为草稿
				if (e) {
					// 临时保存观察草稿
					var cacheForm = this.form
					cacheForm.imagesList = this.fileList1
					cacheForm.childList = this.childList

					// 异步新增本地缓存。
					uni.setStorage({
						key: 'eval_draft',
						data: JSON.stringify(cacheForm)
					})

				} else {
					// 不保存草稿
					// 清除本地缓存
					uni.removeStorage({
						key: "eval_draft"
					})
				}

				this.draftShow = false
				// 手动执行返回
				uni.navigateBack({
					delta: 1
				})
			},

			get_univalence() {
				// 获取ai分析单次使用价格
				let _that = this;
				getAgreement(4).then(res => {
					console.log("res: " + JSON.stringify(res));
					console.log(res.data.content);
					_that.univalence = res.data.content
				}).catch(err => {

				})
			},
			showAlertQR() {
				// iOS设备弹出二维码
				this.loading = true;
				const data = {
					"memberId": "",
					"couponCode": "",
					"type": "2",
				};
				getServiceQRCode(data).then(res => {
					console.log("getServiceQRCode" + JSON.stringify(res));
					if (res.code == 200) {
						this.QRUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + res.data
						this.showQR = true;
					}
					this.loading = false;
				}).catch(err => {
					this.showQR = true;
					this.loading = false;
				})
			},
			onClicktoVip() {
				// 成为会员
				uni.navigateTo({
					url: '/pages-sub/Vip/Vip'
				})
			},

			android_payConfirm() {
				let _that = this;
				// 单次使用ai缴费
				if (this.systemInfo.platform === "ios") {
					this.showAlertQR()
				} else {
					from(createEvaluateOrder()).pipe(
						// 创建订单
						switchMap(res => {
							// 支付
							return from(_that.createPayment(res.data)).pipe(
								// 延迟两秒
								delay(2000),
								// switchMap(() => {
								// 	// 支付成功，单次AI使用数量加一
								// 	return from(addAiCount())
								// })
							);
						}),
						map(Response => {
							// 加一成功的值 输出
							console.log("Ai 使用次数加一成功后 Response: " + JSON.stringify(Response));
							return Response;
						})
					).subscribe(res => {
						// 订阅单次支付成功结果，直接使用ai助手
						this.handleAssistantSave()
					})
				}
			},

			createPayment(data) {
				let _that = this
				return new Promise((resolve, reject) => {
					uni.requestOrderPayment({
						provider: 'wxpay', //支付类型-固定值
						timeStamp: data.timeStamp.toString(), // 时间戳（单位：秒）
						nonceStr: data.nonceStr, // 随机字符串
						package: data.prepayId, // 固定值
						signType: "RSA", //固定值
						paySign: data.paySign, //签名
						success: function(res) {
							// 支付成功
							resolve(res)
							// 提示支付成功
							uni.showToast({
								title: '支付成功',
								icon: 'success',
								duration: 2000,
								complete() {
									// 提示结束，直接去调用ai分析
								}
							})
						},
						fail: function(err) {
							reject(err)
							console.log('fail:' + JSON.stringify(err));
							// 支付失败，展示支付失败提示
							wx.showToast({
								title: '支付失败',
								icon: 'none'
							})
						}
					})
				});
			},

			// 不等待ai生成结果
			onclickHide() {
				this.aiAssistant = false;
				this.cache = false // 直接返回观察信息不存草稿
				let pages = getCurrentPages()
				if (pages.length >= 1) {
					uni.navigateBack()
				}
			},

			isDateEndof(startTime, endTime, m) {
				// 创建目标日期 "2024-08-31"
				let startDate = new Date(startTime);
				let endDate = new Date(endTime);
				// 获取当前日期
				let currentDate = new Date();

				// 计算两个月后的日期
				let twoMonthsLater = new Date(endDate);
				twoMonthsLater.setMonth(endDate.getMonth() + m);

				// 检查当前日期是否在目标日期之后的两月以内
				if (currentDate > startDate && currentDate <= twoMonthsLater) {
					console.log("当前日期在 '2024-08-31' 之后的两月以内。");
					return true
				} else {
					console.log("当前日期不在 '2024-08-31' 之后的两月以内。");
					return false
				}

			},

			assistantShowOpen() {
				let _that = this;

				if (this.form.name.length <= 0) {
					this.errMsg = "请选择评价的孩子"
					this.toast1 = true
					return
				}

				if (this.form.startTime.length <= 0 || this.form.endTime.length <= 0) {
					this.errMsg = "请选择评价的学期"
					this.toast1 = true
					return
				}


				let data = {
					'childId': this.form.childId,
					'startTime': this.form.startTime,
					'endTime': this.form.endTime,
				};
				console.log("----getTermCount---------", JSON.stringify(data));
				getTermCount(data).then(res => {
					console.log("----getTermCount---------", res);
					if (res.data > 0) {
						// 弹出ai助手 分析选项
						this.assistantPopupShow = true
					} else {
						if (this.isDateEndof(this.form.endTime, 3)) {
							// 提示去创建观察
							this.draft2Show = true;
						} else {
							this.draft3Show = true;
						}

					}

				}).catch(err => {
					console.log("----err---------", err);
				})
			},

			// 删除图片
			deletePic(event) {
				let item = this[`fileList${event.name}`][event.index]

				const data = {
					"path": item.url
				};
				console.log("data: " + JSON.stringify(data));
				deletefile(data).then(res => {

				}).catch(err => {
					console.log(err);
				})

				this[`fileList${event.name}`].splice(event.index, 1)

			},
			// 新增图片
			async afterRead(event) {
				console.log(event);
				console.log(JSON.stringify(event));
				console.log();
				if (event.file[0].type == "video") {
					this.fileType = "video"
				} else {
					this.fileType = "image"
				}
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this[`fileList${event.name}`][fileListLen]
					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
			},
			uploadFilePromise(url) {
				return uploadfile(url)
			},

			// 观察内容校验
			handleSave() {

				console.log(this.form);
				let _that = this
				if (this.form.name.length <= 0) {
					this.errMsg = "请选择评价的孩子"
					this.toast1 = true
					return
				}

				if (this.form.startTime.length <= 0 || this.form.endTime.length <= 0) {
					this.errMsg = "请选择评价的学期"
					this.toast1 = true
					return
				}


				if (this.form.content == null || this.form.content == "") {
					console.log("-=--=-=--=-");
					this.errMsg = "请填写该孩子的学期评价"
					this.toast1 = true
					return
				}

				if (this.form.content.length < 10) {
					this.errMsg = "评价内容过少"
					this.toast1 = true
					return
				}

				this.saveObserve()
			},

			async saveObserve() {
				uni.removeStorage({
					key: "eval_draft"
				})
				// 创建观察直接保存
				console.log(this.fileList1);

				this.form.imageList = this.fileList1.map(item => item.url)

				// this.form.aiAnalysisReq = this.assistantSelect
				this.form.aiAnalysisReq = []
				// if (this.assistantSelect.length > 0) {
				// 	// 选择了ai分析参数，提示ai生成
				// 	this.aiAssistant = true;
				// }
				this.loading = true;
				console.log("res: " + JSON.stringify(this.form));
				if (this.type == "update") {

					from(updateEvaluate(this.form)).subscribe((res) => {
							console.log("-------------------" + res);
							if (res.code === 200) {
								this.cache = false;
								if (this.assistantSelect.length <= 0) {
									this.isSus = true
									this.toastShow(true, true, "学期评价修改完成")
								}
								setTimeout(() => {
									this.savePopupShow = false;
								}, 1500)

								let pages = getCurrentPages();
								if (pages.length > 1) {
									uni.navigateBack();
								}
								uni.$emit('RefreshEvalList', null)
							} else if (res.code === 6001) {
								// 不能使用ai分析助手，弹出请缴费
								this.payConfirmShow = true;
								return

							} else {
								this.toastShow(true, false, res.message)
							}
						},
						error => {
							console.log("==========00===========" + error);
							this.toastShow(true, false, res.message)
						},
						complete => {
							this.loading = false;
							console.log("==========complete===========");
						}
					)

				} else {

					from(creatEvaluate(this.form)).subscribe((res) => {
							this.loading = false;
							if (res.code === 200) {
								this.cache = false; //创建的学期评价不需要存草稿
								this.isSus = true;
								this.toastShow(true, true, "创建成功")

								setTimeout(() => {
									// this.aiAssistant = false;
									this.dismiss()

									if (res.data && res.data.isBadge && res.data.isBadge == 1) {
										// 提示获得徽章
										// 提示获得徽章
										this.visibility$.next(!this.alertBadgeShow);
										this.result = res.data;
										this.visibility$.pipe(
											filter(isVisible => !isVisible)
										).subscribe(() => {
											let pages = getCurrentPages();
											if (pages.length > 1) {
												uni.navigateBack();
											}
										})

									} else {
										let pages = getCurrentPages();
										if (pages.length > 1) {
											uni.navigateBack();
										}
									}
									uni.$emit('RefreshEvalList', null)
								}, 1500);
							} else if (res.code === 6001) {
								// 不能使用ai分析助手，弹出请缴费
								this.payConfirmShow = true;
							} else {
								this.toastShow(true, false, res.message)
							}
						},
						error => {
							this.loading = false;
							console.log("=====================" + JSON.stringify(error));
							// this.toastShow(true, false, res.message)
						},
						complete => {
							console.log("==========complete===========");
						}
					)
				}
			},

			// 超级助教选择事件
			handleAssistant(even) {

				console.log(even)
				if (even == "Additional.Items.Freely") {
					this.form.areas = this.areas;
				}

			},
			getEvalSignal(formid, resp) {
				let _that = this
				return interval(2000).pipe(
					concatMap(() => {
						if (formid) {
							// 更新观察
							return from(getAiById(resp.data))
						} else {
							return from(getAiById(resp.data))
						}
					}),
					takeWhile((result) => {
						if (result.data.status == 1) {
							// ai分析完成
							// _that.form.aiAnalysis = result.data.aiAnalysis
							// 将ai结果拼接到手动输入的内容之后
							_that.form.content = result.data.content
							// 修改ai分析状态，已经生成
							_that.form.status = "1"

							_that.aiAssistant = false;
							_that.type = "update" // ai生成以后再点击保存，就是更新
							_that.form.id = result.data.id

							// 返回首页
							this.cache = false
							uni.navigateBack()
							//停止轮询请求
							return false
						}
						return true
					})
				)
			},
			// 超级助教保存
			handleAssistantSave() {
				var _that = this
				this.assistantPopupShow = false;
				this.assistantSelect = this.assistant.map(item => {
					return item.value
				})
				this.form.imageList = this.fileList1.map(item => item.url)
				// ai分析选项
				this.form.aiAnalysisReq = this.assistantSelect
				// 选择领域

				if (this.assistant[0].value == "Additional.Items.Freely") {
					this.form.areas = this.areas1s;
				}

				if (this.assistant[0].value == "Additional.Items.Freely") {
					this.form.areas = this.areas2s;
				}

				// 评价的孩子
				console.log(JSON.stringify(this.form));


				_that.form.status = "2" // 默认为生成中


				// 现获取会员信息
				// 获取一次用户信息, 会员是否有效
				// 发起请求
				from(getTeacherInfo()).pipe(
					tap(res => {
						_that.updateUserInfo(res.data)
					}),
					filter(res => {
						if (this.userInfo.memberType === 0 && this.userInfo.aiUseCount <= 0) {
							// 没有会员权限
							// 弹出加入会员
							this.android_payConfirmShow = true;
							return false
						} else {
							// 有会员权限
							// 显示ai分析loading
							this.aiAssistant = true;
							// 继续信号流
							return true
						}
					}),
					switchMap(res => {
						if (_that.form.id) {
							// 更新观察的接口只返回一个观察消息的ID值
							return from(updateEvaluate(_that.form))
						} else {
							return from(creatEvaluate(_that.form))
						}
					})
				).pipe(
					switchMap((firstResponse) => {
						return interval(2000).pipe(
							concatMap(() => {
								if (_that.form.id) {
									// 更新观察
									return from(getAiById(firstResponse.data))
								} else {
									return from(getAiById(firstResponse.data))
								}
							}),
							takeWhile((result) => {
								if (result.data.status == 1) {
									// ai分析完成

									// 返回首页
									this.cache = false
									uni.navigateBack()
									//停止轮询请求
									return false
								}
								return true
							})
						)
					})
				).subscribe((res) => {
						console.log(JSON.stringify(res));
						console.log("=============subscribe============");
					},
					error => {
						console.log("=============aierror============" + error);
						this.aiAssistant = false;
					},
					complete => {
						console.log("=============aicomplete============");
						this.aiAssistant = false;
						uni.$emit('RefreshEvalList', null)
					}
				)

			},
		}
	}
</script>

<style lang="scss">
	page {
		position: relative !important;
		top: 0px !important;
	}

	::v-deep.u-input {
		padding: 0 !important;
		border: none;
	}

	::v-deep.u-input__content {
		background-color: #f4f7f9;
		padding: 20rpx 20rpx 20rpx 70rpx;
		border-radius: 10rpx;
		font-size: 28rpx;
		line-height: 40rpx;
		letter-spacing: 3rpx;
	}

	::v-deep.uni-input-input:disabled {
		background-color: #f4f7f9;
	}

	::v-deep.u-form-item__body__right__content {
		// background-color: #f4f7f9;
	}

	::v-deep.u-input {
		background-color: #f4f7f9;
	}

	.add-observe {
		padding-bottom: 30rpx;

		.header {
			position: relative;


			.bg {
				width: 100%;
				height: 64px;
				// height: 367rpx;
				position: fixed;
				z-index: 998;
				left: 0;
				top: 0;
			}

			.bg-bottom {
				position: fixed;
				left: 0;
				top: 64px;
				z-index: 990;
				width: 100%;

			}
		}

		.body {
			position: relative;
			z-index: 991;

			.form {
				position: relative;
				top: 70rpx;

				.title {
					font-family: PingFangSC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: rgba(0, 0, 0, 0.85);
					line-height: 40rpx;
					text-align: left;
					font-style: normal;
				}

				.cell {
					margin-top: 16rpx;
					height: 88rpx;
					display: flex;
					align-items: center;


					.icon {
						position: absolute;
						display: flex;
						align-items: center;

						.icon_img {
							position: relative;
							width: 32rpx;
							height: 32rpx;
							left: 20rpx;
						}
					}

					.arrow {
						position: absolute;
						right: 28rpx;
					}
				}


			}

			.observe-memoir-input,
			.observe-analyze-measure-input {
				min-height: 306rpx;
				// background: #F4F7F9;
				border-radius: 20rpx;

				font-size: 28rpx;
				line-height: 40rpx;
				letter-spacing: 3rpx;

				margin-left: -20rpx;
				margin-right: -20rpx;
			}

			::v-deep .input-placeholder {
				// color: #b2b2b2 !important;
				font-size: 28rpx;
				line-height: 30rpx;
				height: 100rpx !important;

				width: 100rpx !important;
			}

			.u-textarea--radius {
				border: none;
				background-color: transparent;
			}

			.u-textarea__field {
				font-size: 28rpx;
				font-weight: 400;
				// color: #000000;
				color: #3A3D4B;
			}

			.create-wrap {
				display: flex;
				align-items: center;
				margin-top: 10px;
				margin-bottom: 100rpx;

				.observe-assistant {
					flex: 2;
					height: 88rpx;
					background-color: #FFA930;
					border-radius: 44rpx;
					display: flex;
					justify-content: center;
					align-items: center;

					.icon {
						width: 29px;
						height: 29px;
					}

					text {
						font-size: 16px;
						font-family: PingFangSC, PingFang SC;
						font-weight: 600;
						color: #FFFFFF;
						line-height: 22px;
					}
				}

				.save-btn {
					flex: 1;
					margin-left: 10px;

					.u-button--square {
						height: 88rpx;
						border: none;
						border-radius: 44rpx;
						background-color: #58C866;
					}

					.u-button__text {
						font-size: 16px;
						font-weight: bold;
						color: #fff;
					}
				}

			}



			.observe-details-list {
				width: 650rpx;
				height: 90rpx;
				line-height: 90rpx;
				border-bottom: 1rpx solid #EBECED;
				color: #273344;

				.icon {
					width: 32rpx;
					height: 32rpx;
					vertical-align: middle;
				}

				.text {
					margin-left: 14rpx;
				}
			}

			.observe-child {
				margin-top: 64px;
			}




			.headImg {
				display: flex;
				justify-content: flex-end;
				align-items: center;
				flex: 1;
				height: 90rpx;
				position: relative;

				.image {
					width: 60rpx;
					height: 60rpx;
					margin: 0 5rpx;
					border-radius: 50%;
					position: relative;
				}

				.image:nth-child(5)::after {
					content: "•••";
					right: 0;
					position: absolute;
					text-align: center;
					line-height: 60rpx;
					top: 0;
					z-index: 99;
					display: inline-block;
					color: #fff;
					width: 60rpx;
					height: 60rpx;
					border-radius: 50%;
					background-color: rgba(0, 0, 0, 0.3);
				}

				.mask {
					position: absolute;
					top: 0;
					left: 0;
					background-color: rgba(0, 0, 0, 0.6);
					width: 60rpx;
					height: 60rpx;
					border-radius: 50%;
					z-index: 999;
				}
			}
		}

		.assistant-popup {
			.u-popup__content {
				width: 600rpx;
				// height: 650rpx;
				border-radius: 20rpx;
				border: 12rpx solid #F4F8F7;

				.assistant-icon {
					width: 240rpx;
					height: 288rpx;
					position: absolute;
					right: -12rpx;
					top: -190rpx;
				}

				.title {
					line-height: 22rpx;
					border-bottom: 12rpx solid rgba(88, 200, 102, .55);
					box-sizing: border-box;
					margin-top: 40rpx;
					margin-left: 28rpx;
				}

				.data-v-c4a74aee {
					font-size: 28rpx !important;
					color: #3A3D4B;
				}

				.u-checkbox__icon-wrap--circle {
					width: 32rpx !important;
					height: 32rpx !important;
				}

				.select-cnt {
					padding: 35rpx 28rpx 0;
				}

				.assistant-btn {
					width: 244rpx;
					height: 72rpx;

					.u-button--square {
						border-radius: 44rpx;
						background-color: #F2F3F7;
						color: #3A3D4B;
						border: none;
					}

					&.save {
						.u-button--square {
							background-color: #58C866;
							color: #FFF;
						}
					}
				}
			}
		}

		.popup-term {
			.title {
				display: flex;
				justify-content: center;
				align-items: center;
				height: 80rpx;
				color: #3A3D4B;
				font-size: 34rpx;
				font: bold;
				letter-spacing: 3rpx;
			}

			.item {
				width: 100%;
				height: 112rpx;
				background-color: #FFFFFF;
				display: flex;
				justify-content: center;
				align-items: center;

				&.bg {
					background-color: #F8F9FB;
				}

				.text {
					color: #3A3D4B;
					font-size: 32rpx;
				}

				.mark {
					width: 36rpx;
					height: 36rpx;
					position: absolute;
					right: 50rpx;
					visibility: hidden;

					&.show {
						visibility: visible;
					}
				}
			}
		}

		.picker-btn {
			display: flex;
			margin-top: 10rpx;
			border-top: 1rpx solid aliceblue;
			padding-top: 20rpx;

			.btn {
				flex: 1;
				width: 200rpx;
				height: 72rpx;
				// color: #58C866;
				// background: #FFFFFF;
				// border-radius: 36rpx;
				// border: 2rpx solid #58C866;
				text-align: center;
				line-height: 72rpx;
				margin: 0 10rpx;
			}

			.confirm {
				color: #58C866;
				// color: #fff;
			}
		}

		.popup {
			.u-popup__content {
				position: relative;
				border-radius: 24rpx 24rpx 0 0;
				overflow: hidden;
				padding-bottom: 100rpx;
			}

			.u-picker__view {
				height: 360rpx !important;
			}

			.u-toolbar__wrapper__cancel {
				padding: 0;
				position: absolute;
				left: 100rpx;
				bottom: -78rpx;

				width: 200rpx;
				height: 80rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.u-toolbar__wrapper__confirm {
				padding: 0;
				position: absolute;
				right: 100rpx;
				bottom: -78rpx;

				width: 200rpx;
				height: 80rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}

	}

	.picker-view {
		width: 100%;
		height: 400rpx;
		margin-top: 20rpx;

		.item {
			line-height: 100rpx;
			text-align: center;
		}
	}
</style>